#!/usr/bin/perl -I ./thirds -w
#
#  Author: Micro Li(microli@sz.webex.com) 03/01/2007
#  analyse cvs log base on 'cvs rlog -r rev module_name' log
#

use strict;
use Data::Dumper;
use CcvUtil;

my $ccvUtil = new CcvUtil();


my $pms = {};
$pms->{filter} = ".java;.js__SP__.cpp;.bat__SP__sdhfasdj/sdfasdj/sdf;sdfk/sdf/sdaf__SP__aa/dsf;sdf/sdf";

$ccvUtil->constructFilterInfo($pms);

print Dumper($pms);

my $files = [
	"/branches/T27L10N_FR23/src/java/MC/atwbxmgr/ConfMgr.java",
	"/branches/T27L10N_FR23/src/java/MC/athybrid/HybridMgr.java",
	"/branches/T27L10N_FR23/src/java/MC/athybrid/athybrid.ver",
	"/branches/T27L10N_FR23/src/java/MC/atphone/ServicePhoneMgr.cpp",
	"/branches/T27L10N_FR23/src/java/MC/atphone/atphone.ver",
	"/branches/T27L10N_FR23/src/java/MC/atwbxmgr/AtUserDB.java",
	"/branches/T27L10N_FR23/src/java/MC/atwbxmgr/MMVideoMgr.java",
	"/branches/T27L10N_FR23/src/java/MC/atwbxmgr/atwbxmgr.ver",
	"/branches/T27L10N_FR23/src/java/MC/atwbxmgr/jmeetingclient.ini"
];

#my $OFilter = {
#	filterNeeded => 1,
#	finLen => 1,
#	fexLen => 1,	
#	
#	dinCnt => 3,
#	dexCnt => 1,
#	
#	fin => ";.java;.cpp;",
#	fex => ";.ver;",
#	
#	din => [
#		"/athybrid",
#		"/atwbxmgr",
#		"/atphone",
#	],
#	
#	dex => [
#		"/atphone"
#	]	
#};

my $OFilter = $pms->{OFilter};
print Dumper($OFilter);

print "filterInfo: " . $ccvUtil->getShownFilterInfo($OFilter);

for (my $i = 0; $i <= $#{$files}; $i++) {
	my $file = $files->[$i];
	
	my $ret = $ccvUtil->filter($file, $OFilter);
	
	print "$file => $ret\n";
}


#$in = ">=10/1/2010";
#$ret = $util->convertDateLogic2SvnNeeded($in);
#print "in: $in -- out: $ret\n";
#
#$in = ">10/1/2010";
#$ret = $util->convertDateLogic2SvnNeeded($in);
#print "in: $in -- out: $ret\n";
#
#$in = "<=10/10/2010";
#$ret = $util->convertDateLogic2SvnNeeded($in);
#print "in: $in -- out: $ret\n";
#
#$in = "<10/10/2010";
#$ret = $util->convertDateLogic2SvnNeeded($in);
#print "in: $in -- out: $ret\n";
#
#$in = "10/10/2011>=10/10/2010";
#$ret = $util->convertDateLogic2SvnNeeded($in);
#print "in: $in -- out: $ret\n";
#
#$in = "10/10/2011>10/10/2010";
#$ret = $util->convertDateLogic2SvnNeeded($in);
#print "in: $in -- out: $ret\n";
#
#$in = "10/10/2009<=10/10/2010";
#$ret = $util->convertDateLogic2SvnNeeded($in);
#print "in: $in -- out: $ret\n";
#
#$in = "10/10/2009<10/10/2010";
#$ret = $util->convertDateLogic2SvnNeeded($in);
#print "in: $in -- out: $ret\n";
#
##print Dumper($as);
#
#
#
#my $revs = "aaaaaaaaaaaaa";
#print $as->getCvsLogRevs($revs) . "\n";
#
#$revs = "123:4345\@";
#
#if ($revs =~ m/^(\d+:\d+)\@(.*)$/) {
#	if ($2 eq "") {
#		print "********* $2\n";
#	}
#	print "********* $2\n";
#}
#print Dumper($as->getSvnLogRevsInfo($revs)) . "\n";


#open($HF, 'operate/2010-10-21/083308/MAIN/c7.widget/all.revs.df');
#seek($HF, $ARGV[0], 0);
#read($HF, $con, ($ARGV[1] - $ARGV[0]));
#close($HF);
#
#print $con;
#
#my $aa= {'a' => 0, 'b' => 1};
#print keys(%{$aa}) ."\n";

#my $df =<<'DF_TXT';
#Index: tokenfield.htm
#===================================================================
#--- tokenfield.htm	(revision 575)
#+++ tokenfield.htm	(revision 576)
#@@ -44,14 +44,13 @@
# 		var doc = $(document.body);
# 		if ($.browser.msie) {
# 			if ($.browser.version == "8.0") {
#-				doc.addClass("msie").addClass("iev8");
#-			}
#-			else if ($.browser.version == "7.0"){
#-				doc.addClass("msie").addClass("iev7");
#+				doc.addClass("msie").addClass("iev8_");
#+			}else if ($.browser.version == "7.0"){
#+				doc.addClass("msie").addClass("iev7_");
# 			}else if($.browser.version == "9.0"){
#-				doc.addClass("msie").addClass("iev9");
#+				doc.addClass("msie").addClass("iev9_");
# 			}else{
#-				doc.addClass("msie").addClass("iev6");
#+				doc.addClass("msie").addClass("iev6_");
# 			}
# 		}
# 		else 
#@@ -44,14 +44,13 @@
# 		var doc = $(document.body);
# 		if ($.browser.msie) {
# 			if ($.browser.version == "8.0") {
#-				doc.addClass("msie").addClass("iev8");
#-			}
#-			else if ($.browser.version == "7.0"){
#-				doc.addClass("msie").addClass("iev7");
#+				doc.addClass("msie").addClass("iev8_");
#+			}else if ($.browser.version == "7.0"){
#+				doc.addClass("msie").addClass("iev7_");
# 			}else if($.browser.version == "9.0"){
#-				doc.addClass("msie").addClass("iev9");
#+				doc.addClass("msie").addClass("iev9_");
# 			}else{
#-				doc.addClass("msie").addClass("iev6");
#+				doc.addClass("msie").addClass("iev6_");
# 			}
# 		}
# 		else 
#@@ -44,14 +44,13 @@
# 		var doc = $(document.body);
# 		if ($.browser.msie) {
# 			if ($.browser.version == "8.0") {
#-				doc.addClass("msie").addClass("iev8");
#-			}
#-			else if ($.browser.version == "7.0"){
#-				doc.addClass("msie").addClass("iev7");
#+				doc.addClass("msie").addClass("iev8_");
#+			}else if ($.browser.version == "7.0"){
#+				doc.addClass("msie").addClass("iev7_");
# 			}else if($.browser.version == "9.0"){
#-				doc.addClass("msie").addClass("iev9");
#+				doc.addClass("msie").addClass("iev9_");
# 			}else{
#-				doc.addClass("msie").addClass("iev6");
#+				doc.addClass("msie").addClass("iev6_");
# 			}
# 		}
# 		else  		 		
#DF_TXT
#
#
#my $uDiffer = new UDiffer();
#
#$uDiffer->genDiffHtml(\$df);
#
#if (!open(H, ">", "web/dftst.html")) {
#	print "error open file\n";
#} else {
#	print H $uDiffer->{outHtml};		
#	close(H);
#}

